package com.xc.pattern.factory.abstractFactory;

import com.xc.pattern.factory.abstractFactory.ali.AliOrderFactory;
import com.xc.pattern.factory.abstractFactory.wecaht.WechatOrderFactory;

/**
 * @author xingchen
 * @description 超级工厂创造器,简单工厂模式
 * @create 2022-08-18 22:27
 */
public class FactoryProducer {
    //超级工厂⽣产器，传参生产对应的子工厂
    public static OrderFactory getFactory(String type) {
        if (type.equalsIgnoreCase("WECHAT")) {
            return new WechatOrderFactory();

        } else if (type.equalsIgnoreCase("ALI")) {
            return new AliOrderFactory();
        }
        return null;
    }
}
